<template>
    <div class="navbar">
    <div class="logo">Logo</div>
    <div class="nav-links">
      <a href="#home">Home</a>
      <a href="#about">About</a>
      <a href="#services">Services</a>
      <a href="#contact">Contact</a>
    </div>
  </div>

  <br>
  <hr>
  <br>

  <div class="card-container">
    <div class="card" v-for="card in cards" :key="card.id">
      <h3>{{ card.title }}</h3>
      <p>{{ card.content }}</p>
    </div>
  </div>

  <br>
  <hr>
  <br>

  <div class="layout-container">
    <div class="box">1</div>
    <div class="box">2</div>
    <div class="box">3</div>
    <div class="box">4</div>
    <div class="box">5</div>
    <div class="box">6</div>
    <div class="box">7</div>
    <div class="box">8</div>
    <div class="box">9</div>
    <div class="box">10</div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';

const cards = ref([
    { id: 1, title: 'Card 1', content: 'This is the content of card 1' },
    { id: 2, title: 'Card 2', content: 'This is the content of card 2' },
    { id: 3, title: 'Card 3', content: 'This is the content of card 3' },
    { id: 4, title: 'Card 4', content: 'This is the content of card 4' },
    { id: 5, title: 'Card 5', content: 'This is the content of card 5' },
    { id: 6, title: 'Card 6', content: 'This is the content of card 6' },
]);

</script>

<style lang="less" scoped>
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    color: white;
    padding: 10px 20px;
}
.logo {
    font-size: 24px;
    font-weight: bold;
}
.nav-links {
    display: flex;
    gap: 15px;
}
.nav-links a {
    color: white;
    text-decoration: none;
}
.nav-links a:hover {
    text-decoration: underline;
}

// 卡片容器
.card-container {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    justify-content: space-between;
    align-items: center;
}
.card {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 10px;
    padding: 15px;
    width: 200px; /* 可以根据需要调整宽度 */
    text-align: center;
    transition: transform 0.3s ease;
    &:hover {
        transform: translateY(-5px);
    }
}

.layout-container {
    box-sizing: border-box;
    margin: 0 auto;
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(102, 100, 100, 0.1);
    .box {
        background-color: #7c9f80;
        width: 300px;
        height: 200px;
        border-radius: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        margin-bottom: 40px;
    }
}

</style>